008 drawing tools and animations

我会在这里写一些完全有用的东西。
I'll write something that's just totally useful here.

我们现在将讨论绘图和动画,即使您不是艺术家,也不是动画师,当您真正开始构建 H.
We're going to be looking now at drawing and animation and even though you're not an artist and even though you're not an animator you're going to see very soon when ever you really start building H.

迈尔斯说,你总是需要做一些绘画,你总是需要做一些动画。
Myers that you always need to do a little bit of drawing and you always need to do a little bit of animating.

因此,在这种情况下,让我们进行一些设置。
So in this case let's set something up.

我们将假装这个滑块实际上是我们要控制的水箱内的水位。
We're going to pretend that this slider is actually a water level inside of a tank that we're going to be controlling.

因此,在这个空旷的空间中,我将继续绘制该水箱,我想显示水箱内部充满的水位。
So over here in this empty space I'm going to go ahead and draw that tank and I want to show the water level filling up inside of the tank.

好的。
OK.

所以让我们来看看形状,你可以看到我有直线、矩形、圆形、三角形和框架,首先是。
So let's come over here to shapes and you can see I've got lines rectangles circles triangles and frames Well to start with.

我将下拉一个矩形,您可以看到这里有一些不同的形状。
I'm going to drop down a rectangle and you can see I've got a handful of different shapes here.

让我们继续将这个带有圆角的矩形带到这里,我将在这里使这条线稍微粗一点。
Let's go ahead and bring this rectangle over here with the rounded corners and I'm going to make that line with a little bit thicker here.

好的。
OK.

实际上让我回到那里并填充它,我将给它一种灰色,比如说可能是一点中灰色作为背景,这样这将是一个空水箱的样子。
And actually let me go back in there and also fill it and I'm going to give it kind of a gray let's say maybe a little medium gray as a background so that's going to be what an empty tank looks like.

如果你能发挥一点想象力,那就是我的坦克。
If you can use your imagination a little bit and that's going to be my tank.

那么,让我们继续引入另一个类似的矩形,在这个矩形中,我们将使用蓝色的四号线,并且我们还将填充它。
So then let's go ahead and bring in another similar rectangle and this one we're going to use a blue line four and we're also going to fill that.

对于失败,该颜色将是相同的蓝色,我将继续并单击“确定”并将其移至此处。
And that one's going to be a same blue color for the fail and I'm going to go ahead and hit OK and move this right here.

这将代表水箱内的水。
And this is going to represent the water inside of the tank.

所以我要把它放在那里,然后把它缩小,直到它只是一个水坑。
So I'm going to put it there and I'm going to shrink this thing down till it's just a puddle.

好的,现在让我再回到那里一次,我将进入高级,一旦完成,我的填充现在将取决于标签。
OK so now let me go back in there one more time and I'm going to hit advanced and once I do my fill is now going to be dependent upon tag.

所以我将使用一个始终打开的标签。
So I'm going to use a tag that's just always going to be on.

我将使用 CIS 位,然后我们到这里来调整尺寸,我将使用尺寸动画。
I'll use the CIS bit on and then let's come over here to size and I'm going to use a sizing animation.

所以这个动画的基础是永远不会移动的部分。
So the base of this animation the part that's never going to move.

假设它将位于左下角,或者我们可以使用右下角,因为我们实际上只会垂直而不是水平地动画这个东西。
Let's say it's going to be the bottom left or we could use the bottom right because we're really going to only animate this thing vertically not horizontally.

然后我们采用 y 轴标签,它指的是我们的模式,这与我们在数字输入上使用的模式相同,我们的 PLCC 值的范围是 0 到 100,我们的动画大小是从 0 到.
Then let's take the y axis tag and that's going to refer to our mode which is the same thing that we're using over here on our numeric input and our PLCC value is going to range from 0 to 100 and our animations size is going to be from 0 to.

让我们尝试一百次,看看这会让我们处于什么位置,但我们必须做一些工作来弄清楚我们想要的到底是什么。
Let's try a hundred and see where that puts us but we're going to have to do a little work to figure out exactly where we want to be with that.

然后让我们继续模拟并点击开始。
And then let's go ahead and simulate and hit start.

所以现在当我向上移动这个滑块时,您可以看到我们的水箱开始充满,但我们肯定需要一百多个才能使水箱液位达到那里。
So now when I move this slider up you can see now that our tank starts to fill but we're definitely going to need more than a hundred to get that tank level up there.

那么让我们回去尝试一下 500 之类的东西。
So let's go back and try something like maybe 500.

所以我要再次双击我的水,回到这里进入科学,动画大小将为 500,因为我真的不知道到底有多少像素。
So I'm going to double click on my water again come back over here into science and animation size will be 500 because I really don't know how many pixels that is exactly.

现在让我们尝试提升我的水平。
And let's try and move my level up now.

好吧,有点太高了。
OK it's a little bit too high.

但现在你可以看到我实际上可以展示这个水箱装满了水。
But now you can see that I can actually show this tank filling up with water.

因此,不要将其连接到滑块。
So instead of this being connected to a slider.

想象一下,如果它实际上连接到在程序内部运行的液位变送器,那么我随时可以查看我的水箱,并实际看到水位下降后的变化。
Imagine if this was actually connected up to a level transmitter which was running inside of a program than at any time I could look over at my tank and actually see the water level going after coming down.

所以当你看到这个的时候,这基本上就是动画。
So that's basically animation whenever you're looking at this.

您可以将不同的绘图工具移至此处。
You've got different drawing tools that you can move in here.

实际上,假设创建一条线,当我们进入高级阶段时,我们有旋转选项,因此我们可以说我们想要向左旋转,基本位置将成为中心。
And actually let's say create a line and when we go into advanced we've got rotation options so we can say we want to rotate this left the base position is going to be the center.

我们还将使用它们模式,我们将根据零到 100 信号从零到三百五十九度,它说我需要一个有效的颜色标签。
And we're also going to use them mode and we're going to go from zero to three hundred fifty nine degrees based on our zero to 100 signal and it says I need a valid color tag.

所以当我来到这里时,我会把它关掉,让我的生活充满色彩。
So when I come over here a line color I'm just going to turn that off and I'm going to make my life in color.

让我们选择漂亮的粉红色。
Let's go with the nice pink.

所以我会点击“确定”模拟开始。
So I'll hit OK simulates start.

现在,当我移动滑块时,您可以看到我也在旋转我的线。
And now when I move my slider you can see I'm also rotating my line.

您可以使用动画做很多很多不同的有趣的事情。
There are lots and lots and lots of different fun things you can do with animations.

你可以让事物转动,你可以让事物生长,你可以让事物伸展,你可以让事物在屏幕上移动,就像我想让我的线条实际上使用移动动画移动一样。
You can make things turn you can make things grow you can make things stretch you can make things move across the screen like if I wanted to make my line here actually move using a moving animation.

我可以让它沿着 X 轴移动,我也将其与模式联系起来。
I could make it move along the X-axis and I'm going to tie that to mode as well.

然后我们继续点击“确定”。
And then let's go ahead and hit OK.

点击“模拟”并开始,一旦我这样做,您就可以看到我的线实际上在移动一点。
Hit simulate and start and as soon as I do you can see my line is actually moving a little bit.

它移动的幅度不大,但它不仅仅是旋转,而是实际上在移动。
It's not moving a lot but it is not just rotating it's actually moving.

你可以用动画做很多事情。
So tons of stuff you can do with animation.

我会让你通过并尝试使用绘图工具,但使用简单的线条、矩形、圆形和三角形实际上,如果你只有线条和矩形,你甚至不需要三角形,你真的可以做各种非常惊人的动画在短短几秒钟内绘制泵,然后显示该泵转动的内部结构。
I will let you go through and experiment with the drawing tools but with simple lines and rectangles and circles and triangles Actually you don't even really need triangles if you just have lines and rectangles you can really do all kinds of pretty amazing animations you could in just a few seconds draw pump and then show the internals of that pump turning.

你可以用它做各种各样的事情,非常酷。
There are all kinds of things you can do with this so very cool.

这就是本次讲座我想向您展示的全部内容。
And that's all I wanted to show you for this lecture.

下次见。
See you next time.

干杯。
Cheers.